import 'package:car_map/page/res/gaps.dart';
import 'package:car_map/widget/my_button.dart';
import 'package:flutter/material.dart';

///账号信息
class AccountPage extends StatefulWidget {
  @override
  _accountState createState() => _accountState();
}

class _accountState extends State<AccountPage> {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text('账号信息'),
      ),
      body: Container(
        child: ListView(
          children: <Widget>[
            _listTitle(title: '服务器Ip', count: '192.168.0.211'),
            _listTitle(title: '服务器名称', count: '陕西省211'),
            _listTitle(title: '登录名称', count: '明瑞科技车辆'),
            _listTitle(title: '用户级别', count: '二级管理员'),
            Gaps.vGap50,
            MyButton(
              title: '注销',
              callback: () {},
            ),
          ],
        ),
      ),
    );
  }

  Widget _listTitle({String title, String count, GestureTapCallback callback}) {
    return Container(
      decoration: BoxDecoration(
          border:
              Border(bottom: BorderSide(color: Colors.black12, width: 0.5))),
      child: ListTile(
        title: Text(title),
        trailing: Text(count),
        onTap: callback,
      ),
    );
  }
}
